#include <iostream>
using namespace std;
int main()
{
	int num = 0;
	cin >> num;
	int a = num & (0xaaaaaaaa);
	int b = num & (0x55555555);
	cout << ((a >> 1) ^ (b << 1)) << endl;
	system("pause");
	return 0;
}